//- Copyright (C) 2018-2022 Chatopera Inc, <https://www.chatopera.com>
//- 
//- Licensed under the Apache License, Version 2.0 (the "License");
//- you may not use this file except in compliance with the License.
//- You may obtain a copy of the License at
//- 
//-  http://www.apache.org/licenses/LICENSE-2.0
//- 
//-  Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
if chatMessage.expmsg && chatMessage.expmsg.contains("hyperlink\":\"http")
    - var expmsg = pugHelper.parseStringToJsonArray(chatMessage.expmsg)[0];
    | 图文消息：#{expmsg.title}
    br
    = expmsg.summary
    br
    a(href="#{expmsg.hyperlink}", target="_blank")
        img.ukefu-media-image(src="!{chatMessage.message ? chatMessage.message : ''}", id="#{chatMessage.id}")
else if chatMessage.msgtype == "image"
    a(href=chatMessage.message + "&original=true", target="_blank")
        img.ukefu-media-image(src=chatMessage.message)
else if chatMessage.msgtype == "cooperation"
    a(href="javascript:void(0)", onclick='acceptInvite("' + chatMessage.message + '","' + chatMessage.attachmentid + '"') 您收到一个协作邀请，点击进入协作
else if chatMessage.msgtype == "file"
    .ukefu-message-file
        .ukefu-file-icon
            img(src="/im/img/file.png")
        .ukefu-file-desc
            a(href=chatMessage.message, target="_blank")
                div= chatMessage.filename
                div #{chatMessage.filesize / 1024}Kb
else
    | !{chatMessage.message}
    if chatMessage.suggestmsg && chatMessage.suggestmsg != ""
        .info-list
            for item in chatMessage.suggest
                li.ukefu-suggest-item
                    a.suggestitem(href="javascript:void(0)", onclick="sendMessageTextWithID('" + item.title + "','" + item.id + "')")= item.title
